import MoleCtrl from "./MoleCtrl";
export default class GameRoot extends Laya.Script {

    constructor() { 
        super(); 
    }
    onAwake(){
        Laya.Scene3D.load("res/scene/LayaScene_game/Conventional/game.ls",Laya.Handler.create(this,this.onLoadSceneFinish))
    }
    onLoadSceneFinish(loadScene){
        loadScene.zOrder=-1;
        console.log("Load Success");
        Laya.stage.addChild(loadScene);
        var moles=loadScene.getChildByName("Moles");
        for(var i=0;i<moles.numChildren;i++){
            moles.getChildAt(i).getChildAt(0).addComponent(MoleCtrl);
        }
    }
}